function Operations(ulSel){
	this.$ul = $(ulSel);
	this.$follow = this.$ul.find("#dorimeBtnFollow");
	this.$unfollow = this.$ul.find("#dorimeBtnUnfollow");
	this.$dashboard = this.$ul.find("#dorimeBtnDashboard");
	this.$reblog = this.$ul.find("#dorimeBtnReblog");
	this.$like = this.$ul.find("#dorimeBtnLike");
	this.init();
}

Operations.prototype = {
	init : function(){
		var _this = this;
		this.$follow.click(function(){
			var thisBtn = this;
			// send message to back-end
			var url = $(this).attr("href");
			$.get(url, function(data){
				if(true){
					// show unfollow and hide itself
					$(thisBtn).parent().hide();
					_this.$unfollow.parent().show();
				}else{
					// prompt to redo
				}
			});
			return false;
			
		});
		this.$unfollow.click(function(){
			var thisBtn = this;
			// send message to back-end
			var url = $(this).attr("href");
			$.get(url, function(data){
				if(true){
					// show follow and hide itself
					$(thisBtn).parent().hide();
					_this.$follow.parent().show();
				}else{
					// prompt to redo
				}
			});
			return false;
		});
		this.$like.click(function(){
			var thisBtn = this;
			// send message to back-end
			var url = $(this).attr("href");
			$.get(url, function(data){
				if(true){
					// show follow and hide itself
					$(thisBtn).parent().hide();
				}else{
					// prompt to redo
				}
			});
			return false;
		});
	}
}


$(document).ready(function(){
	var operations = new Operations("#dorimeBtn");
});
